package com.yuyou.tas.admin.service;

import java.util.List;

import com.yuyou.tas.admin.vo.req.AuthOrgan;
import com.yuyou.tas.admin.vo.req.AuthOrganPerson;
import com.yuyou.tas.admin.vo.req.AuthOrganPersonUpdate;
import com.yuyou.tas.admin.vo.req.AuthOrganUpdate;
import com.yuyou.tas.service.api.admin.dto.DtoAuthOrgan;
import com.yuyou.tas.service.api.admin.dto.DtoAuthOrganDetail;
import com.yuyou.tas.service.api.admin.entity.AuthOrganization;
import com.yuyou.tas.service.api.admin.entity.AuthOrganizationExt;
import com.yuyou.tas.util.bean.LoginRedisObj;
import com.yuyou.tas.util.bean.Pagination;
import com.yuyou.tas.util.bean.ResBoolSimpleInfo;

public interface IAuthOrganService {

	/**
	 * 包括密钥
	 * @return
	 */
	List<AuthOrganization> selectAll();

	AuthOrganization selectByPrimaryKey(Long id);
	
    ResBoolSimpleInfo<String> addAuthOrgan(AuthOrgan authOrgan, LoginRedisObj user) throws Exception;
    ResBoolSimpleInfo<String> updateAuthOrgan(AuthOrganUpdate authOrgan);
    ResBoolSimpleInfo<String> delAuthOrgan(Long id);
    ResBoolSimpleInfo<String> addAuthOrganPerson(AuthOrganPerson authOrganPerson, LoginRedisObj user) throws Exception;
    ResBoolSimpleInfo<String> updateAuthOrganPerson(AuthOrganPersonUpdate authOrgan);

    ResBoolSimpleInfo<DtoAuthOrganDetail> getByID(Long id);

    int findOrgPageCount(Pagination<DtoAuthOrgan> p);
    List<DtoAuthOrgan> findOrgPageList(Pagination<DtoAuthOrgan> p);
    
    /**
     * 根据用户账号找出可用的机构
     * @param account
     * @return
     */
    List<AuthOrganizationExt> findActiveOrganByAcc(String account);
    
    /**
     * 根据用户账号找出机构
     * @param account
     * @return
     */
    List<AuthOrganizationExt> findOrganByAcc(String account);

    /**
     * 判断机构账号有效期
     * @param authOrganizationId
     * @return
     */
	ResBoolSimpleInfo<String> validateOrganAcc(Long authOrganizationId);
}